package me.bincker.formwork.web.utils

import org.springframework.beans.BeanUtils.getPropertyDescriptors
import java.beans.PropertyDescriptor
import java.net.URI
import java.net.URL
import java.util.*
import kotlin.reflect.KClass
import kotlin.reflect.full.isSubclassOf

/**
 * Bean拓展工具
 */
object BeanUtils {
    fun isSimpleType(kClass: KClass<*>): Boolean {
        return kClass.isSubclassOf(Number::class) ||
                kClass.isSubclassOf(CharSequence::class) ||
                kClass == Boolean::class ||
                kClass == Date::class ||
                kClass == Enum::class ||
                kClass == URI::class ||
                kClass == URL::class ||
                kClass == Locale::class ||
                kClass == KClass::class
    }
}